import request from '@/utils/request'

// 查询学期列表
export function listYear(query) {
  return request({
    url: '/committee/year/list',
    method: 'get',
    params: query
  })
}

// 查询学期详细
export function getYear(schoolYearId) {
  return request({
    url: '/committee/year/' + schoolYearId,
    method: 'get'
  })
}

// 新增学期
export function addYear(data) {
  return request({
    url: '/committee/year',
    method: 'post',
    data: data
  })
}

// 修改学期
export function updateYear(data) {
  return request({
    url: '/committee/year',
    method: 'put',
    data: data
  })
}

// 删除学期
export function delYear(schoolYearId) {
  return request({
    url: '/committee/year/' + schoolYearId,
    method: 'delete'
  })
}

// 设置当前学期
export function editDefaultSchoolYear(data) {
    return request({
      url: '/committee/year/editDefaultSchoolYear',
      method: 'put',
      data: data
    })
  }